package com.doerit.service;

import java.io.Serializable;
import java.util.List;

import com.doerit.exception.DataRetriveException;
import com.doerit.exception.DatabaseSaveErrorException;
import com.doerit.exception.DuplicateEmailException;
import com.doerit.exception.DuplicateIdException;
import com.doerit.exception.ItemNotFoundException;
import com.doerit.exception.PasswordPolicyErrorException;

public interface GenericService<T, K extends Serializable> {

	List<T> findAll();
	List<T> findAllNotDisabled();
	List<T> findAllDisabled();
	T findById(K id) throws ItemNotFoundException,DataRetriveException;
	int save(T entity) throws DuplicateIdException, DuplicateEmailException, PasswordPolicyErrorException,
		DataRetriveException, DatabaseSaveErrorException;
	int update(T entity) throws DuplicateIdException, DuplicateEmailException, PasswordPolicyErrorException, DataRetriveException;
	int delete(T entity) throws ItemNotFoundException, DataRetriveException;
	int delete(K id) throws ItemNotFoundException, DataRetriveException;

}
